<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/20
 * Time: 17:31
 */

namespace app\common\entity;


use think\Model;

class UserLevelSend extends Model
{
    protected $table = 'user_level_send';


    public static function getCateNameByLevel($user_level)
    {
        $entity = new self();
        $name = $entity->where('level',$user_level)->value('name');

        return $name??'普卡会员';
    }

    static public function getProfit($level,$find){
        if(!$level){
            $level = 1;
        }
        $levelSend = self::where('level',$level)->find();
        return $levelSend[$find];
    }
}